<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="scripts/jquery/jquery-1.7.1.js"></script>
<link href="style/authority/basic_layout.css" rel="stylesheet" type="text/css">
<link href="style/authority/common_style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="scripts/authority/commonAll.js"></script>
<script type="text/javascript" src="scripts/fancybox/jquery.fancybox-1.3.4.js"></script>
<script type="text/javascript" src="scripts/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="style/authority/jquery.fancybox-1.3.4.css" media="screen"></link>
<script type="text/javascript" src="scripts/artDialog/artDialog.js?skin=default"></script>
<title>商品一级分类管理</title>
<style>
	.alt td{ background:black !important;}
</style>
	<script type="text/javascript">
		function category2Insert()
		{
			var name1=document.getElementById("category1").value;
			var name2=document.getElementById("inputname").value;
			document.form1.action="servlet/Categorylv2servlet?type=insert&name1="+name1+"&name2="+name2;
			document.form1.submit();
		}
		function category2Delete(name2)
		{
			var name1=document.getElementById("category1").value;
			document.form1.action="servlet/Categorylv2servlet?type=delete&name1="+name1+"&name2="+name2;
			document.form1.submit();
		}
		function category2Query()
		{
			var name1=document.getElementById("category1").value;
			document.form1.action="servlet/Categorylv2servlet?type=query&name1="+name1;
			document.form1.submit();
		}
	
	
	</script>
</head>
<body>
	<form name="form1" method="post">
		<div id="container">	
		<div class="ui_content">
				<div class="ui_text_indent">
					<div id="box_border">
						<div id="box_top">搜索</div>
						<div id="box_center" >
							<select class="ui_select01" name="category1" id="category1" onChange="category2Query()">
			              		<c:forEach items="${category1}" var="temp">
			              			<c:if test="${temp==selectoption}"><option value="${temp}" selected="selected">${temp} </option></c:if>
			              			<c:if test="${temp!=selectoption}"><option value="${temp}">${temp} </option></c:if>	              			
			              		</c:forEach>
	            			</select>
						</div>
					</div>
				</div>
			</div>		
			<div class="ui_content">
				<div class="ui_tb">
				  <table class="table" width="100%">
			          <tr>
			          	<th>商品一级分类</th>
						<th>操作</th>          
			          </tr>
			          <c:forEach items="${category2 }" var="temp">
			             	<tr>
			             		<td align="center">${temp} </td>
			             		<td><button class="ui_input_btn01" onclick="category2Delete('${temp}')">删除</button></td>
			             	</tr>
			          </c:forEach>
			          <tr>
			          	<td><input id="inputname" type="text"/></td>
			          	<td><button class="ui_input_btn01" onclick="category2Insert()">添加</button></td>
			          </tr>
			        </table>
				</div>
			</div>
		</div>
	</form>
</body>
</html>
